home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Applications / Macintosh Tracker 1.20 / source / Server⁄PlayerPro 4.15 / RDriver.h < prev   
Encoding:
C/C++ Source or Header  |  1994-02-05  |  4.5 KB  |  161 lines  |  [TEXT/KAHL]

  1. #define MAX_ARP 3
  2. #define NUMBER_FINETUNES 17
  3. #define AMIGA_CLOCKFREQ 33659820        //35758720
  4. #define MIN_PITCH 142
  5. #define MAX_PITCH 17161L
  6. #define MIN_VOLUME 0
  7. #define MAX_VOLUME 64
  8. #define ACCURACY 12
  9. #define fix_to_int(x) ((x) >> ACCURACY)
  10. #define int_to_fix(x) ((x) << ACCURACY)
  11. #define    FREQBASE    161L    // -> Utilisé avec le pitch qui est divisé par 10 !!!!!
  12. #define MAXTRACK    32
  13. #define MAXINSTRU    64
  14.  
  15. struct VoiceActive    {
  16.         Ptr            MaxPtr;
  17.         Ptr            InstruVoice;
  18.         long        loopWord;
  19.         long        loopWords;
  20.         int            whichInstru;
  21.         int            whichInstruOld;
  22.         int            lastpitch;
  23.         int            pitch;              /* current pitch of the sample */
  24.         int         realpitch;
  25.         int            volume;
  26.         int            arg;
  27.         int         note;               /* we have to save the note cause */
  28.                                         /* we can do an arpeggio without a new note */
  29.     
  30.         int         arp[MAX_ARP];       /* the three pitch values for an arpeggio */
  31.         int         arpindex;           /* an index to know which note the arpeggio is doing    */
  32.  
  33.         int            viboffset;          /* current offset for vibrato (if any) */
  34.         int         vibdepth;           /* depth of vibrato (if any) */
  35.  
  36.         int         slide;              /* step size of pitch slide */
  37.  
  38.         int         pitchgoal;          /* pitch to slide to */
  39.         int         pitchrate;          /* step rate for portamento */
  40.         int            oldpitchrate;
  41.  
  42.         int         volumerate;         /* step rate for volume slide */
  43.  
  44.         int         vibrate;            /* step rate for vibrato */
  45.         int            oldvibrate;
  46.  
  47.         int         retrig;             /* delay for extended retrig command */
  48.         int         effect;
  49.         int            ID;
  50. };
  51. typedef        struct VoiceActive    VoiceActive;
  52.  
  53. struct    MODPartition    {
  54.         SoundTrackSpec    *header;
  55.         struct    Pattern    *partition;
  56.         Ptr                instrument[ 64];
  57. };
  58. typedef        struct MODPartition    MODPartition;
  59.  
  60. #ifdef MAINSYSTEM
  61. #define EXT
  62. #else
  63. #define EXT extern
  64. #endif
  65.  
  66. EXT    MODPartition            thePartition;
  67. EXT    VoiceActive                theVoiceActive[ MAXTRACK];
  68. EXT    int                        DriverTypeInt, smallcounter;
  69. EXT    unsigned char            InstruEffect;
  70. EXT    int                        Tube[ MAXTRACK], PartitionReader, Pat, PL, VolExt[ MAXTRACK];
  71. EXT    struct Pattern            *PatternInt;
  72. EXT    long                    DBTick, ASCBUFFER;
  73. EXT    int                        TotInstru, speed, finespeed, **FreqHandle, InstruActif[ MAXINSTRU], InstruTube[ MAXINSTRU];
  74. EXT    Ptr                        SysHeapPtr, Vol, IntPtr[ 2], IntPtr2[ 2], PseudoBuf[ 2];
  75. EXT    Boolean                    MODFileType, InternalRestart, Reading, MusiqueFertig, SMTicker;
  76. EXT    SoundTrackSpec            *theFileInt;
  77. EXT    long                    oldNotePosAA, SInc, VMOD, VExt, FreqExt;
  78.  
  79. EXT    Boolean                    DriveStereo, PtrSystem;
  80. EXT    int                        DriveOutBit, DriveTrackNo;
  81.  
  82. extern    int    Tuning[ ], vibrato_table[ ];
  83.  
  84.  
  85. enum {
  86.     ASCMono = 1,
  87.     ASCStereo = 2,
  88.     SMMono = 3,
  89.     SMStereo = 4,
  90.     SMDSP = 5
  91. };
  92.  
  93. enum {
  94.         set_arpeggio = 0,
  95.         set_speed = 15,
  96.         set_skip = 13,
  97.         set_fastskip = 11,
  98.         set_volume = 12,
  99.         set_slidevol = 10,
  100.         set_offset = 9,
  101.         set_portamento = 3,
  102.         set_portaslide = 5,
  103.         set_upslide = 2,
  104.         set_downslide = 1,
  105.         set_vibrato = 4,
  106.         set_vibratoslide = 6,
  107.         set_extended = 14,
  108.         set_nothing = 7,
  109.         do_retrig = 50,
  110.         do_cut = 51
  111.     };
  112.  
  113. void    Sampler8in8( VoiceActive *curVoice, Ptr    ASCBuffer);
  114. void    Sampler8in8Add( VoiceActive *curVoice, Ptr    ASCBuffer);
  115. void    NoteAnalyse( void);
  116. OSErr    RInitMOD( int, int);
  117. void    ChangeTrackNo( int);
  118. OSErr    RLoadMOD( Str255 fName);
  119. OSErr    RPlayMOD(void);
  120. OSErr    RStopMOD(void);
  121. OSErr    RQuitMOD(void);
  122. OSErr    RResetMOD(void);
  123. OSErr    RClearMOD(void);
  124. OSErr    SetUpFrequence( long, long);
  125. OSErr    RLoadMADFRsrc( OSType IDName, short    IDNo);
  126. OSErr    ReadInstrument( short srcFile, long    MODSize, Boolean aRsrc, Handle);
  127. OSErr    AmigatoSnd22(Handle sound, long SizeH);
  128. OSErr    SetMODVol(void);
  129. OSErr     SetMODVol2(void);
  130. void    DoEffect( VoiceActive *);
  131. OSErr    DBSndClose();
  132. void    StopChannel();
  133. OSErr     SetMODVol4( long , long , Boolean );
  134. void    PlayChannel();
  135. void     checkpitch( VoiceActive *, Boolean);
  136. void     BufferCopyM();
  137. OSErr    RInstallMADF( MODPartition aPartition);
  138. void     BufferCopyS();
  139. void    ConvertMod2Mad( Ptr        aMOD, long MODSize, MODPartition        *theMAD);
  140. Ptr        ConvertMad2Mod( MODPartition *theMAD, long MODSize);
  141. void     TestBufferCopyS();
  142. void    RemplaceMODFile( Ptr theNewPtr);
  143. void    MODPlay(void);
  144. void    InstallMODVBL(void);
  145. struct     Command* GetCommand( short Pos, short    TrackId, short Pat);
  146. void     ReadNote( VoiceActive *curVoice, struct Command        *theCommand);
  147. void    RemoveMODVBL(void);
  148. void    MODRelance(void);
  149. void    AmigatoSnd(Handle sound, long SizeH);
  150. void    Play(void);
  151. void    BufferCopyLeft(void);
  152. void    BufferCopyRight(void);
  153. void    VIAOn(void);
  154. void     SndOff(void);
  155. void     SndOn(void);
  156. void     BufferTestM(void);
  157. void    VIAOn2(void);
  158. void     VIAOn3(void);
  159. OSErr    InitDBSoundManager( long);
  160. void    SetUpEffect( int Arg, VoiceActive *ch);
  161. void    DoEffect( VoiceActive *ch);